package dongze.com.ckdj.persistence.dao;

import org.greenrobot.greendao.converter.PropertyConverter;

/**
 * Created by fanqwz on 2017/8/16.
 */
public class StateConverter implements PropertyConverter<State, Integer>{

    @Override
    public State convertToEntityProperty(Integer databaseValue) {
        return State.values()[databaseValue];
    }

    @Override
    public Integer convertToDatabaseValue(State entityProperty) {
        return entityProperty.ordinal();
    }
}
